﻿<div class="span12">
    <div class="widget-box display-close" id="commercialPanel">
        <div class="widget-title">
            <span class="icon"><i class="icon-list-alt"></i></span>
            <h5>新增广告弹窗</h5>
        </div>
        <div class="widget-content">
            <div id="successAlert" class="alert alert-success" style="display:none;"></div>
            <div id="warningAlert" class="alert alert-warning" style="display:none;"></div>
            <form name='newcommercialForm' class="form-horizontal" role="form" style="max-height: inherit;" enctype="multipart/form-data">
                <div class="form-group">
                    <div class="col-sm-1">
                        <label class="inline pull-label s-label-len text-right" for="pic" title="建议图片尺寸为550*600。">上传图片</label>
                    </div>
                    <div class="col-sm-10">
                        <div id="pic" class="demo" style="padding-left: 0;margin-left: 0;"></div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-1">
                        <label class="inline pull-label s-label-len text-right" for="pictag">标题<font class="col-lbl-tq">*</font></label>
                    </div>

                    <div class="col-sm-8">
                        <input name='pictag' type="text" id="pictag" class="m-wrap form-control" placeholder="请输入图片标题" ng-model='qPicData.picTag' required maxlength="15" ng-maxlength="15" />
                    </div>
                </div>

                <div class="form-group form-inline">
                    <div class="col-sm-1">
                        <label class="inline pull-label s-label-len text-right" for="picSTime">起始时间</label>
                    </div>
                    <div class="col-sm-10 form-inline">
                        <div class="picSTime input-append date form_datetime">
                            <input type="text" class="row-control" id="picSTime" data-format="yyyy/MM/dd" ng-model="qPicData.picSTime" name="picSTime" readonly style="color:#141212" />
                            <span class="add-on"><i data-time-icon="icon-time" data-date-icon="icon-calendar"></i></span>
                        </div>
                        <span class="row-mid">~</span>
                        <div class="picETime input-append date form_datetime">
                            <input type="text" class="row-control" id="picETime" data-format="yyyy/MM/dd" ng-model="qPicData.picETime" name="picETime" readonly style="color:#141212" />
                            <span class="add-on"><i data-time-icon="icon-time" data-date-icon="icon-calendar"></i></span>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-sm-1">
                        <label class="inline pull-label s-label-len text-right" for="seq">排序</label>
                    </div>

                    <div class="col-sm-8">
                        <input name='seq' type="number" id="seq" class="m-wrap form-control" placeholder="请输入图片排序" ng-model='qPicData.Seq' onkeyup="value=value.replace(/[^\(^[1-9]\d*$\)]/g,'')" onpaste="value=value.replace(/[^\(^[1-9]\d*$\)]/g,'')" oncontextmenu="value=value.replace(/[^\(^[1-9]\d*$\)]/g,'')" />
                    </div>
                </div>

                <div class="form-group">
                </div>
                <div class="form-group">
                    <div class="col-sm-12 btn-margin-left">
                        <a ng-click='onSave()' class="btn grey btn-primary"><i class="icon-save"></i>保存</a><a ng-click='onCancel()' class="btn btnleftmargin"><i class="icon-remove-sign"></i>取消</a>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="widget-box">
        <div class="widget-title">
            <span class="icon"><i class="icon-reorder"></i></span>
            <h5>广告弹窗列表</h5>
        </div>

        <div class="widget-content table-responsive">
            <div id="successAlert1" class="alert alert-success" style="display:none;"></div>
            <div id="warningAlert1" class="alert alert-warning" style="display:none;"></div>

            <div class="form-group" style="float: right;">
                <a ng-click='onAdd()' class="btn btn-info"><i class="icon-plus-sign"></i>新增</a>
            </div>
            <table ng-table="tableParams" class="table table-striped table-bordered table-hover">
                <thead class="panel panel-default">
                    <tr class="panel-heading">
                        <th class="hidden-480">序号</th>
                        <th class="hidden-480">标题</th>
                        <th class="hidden-480">图片</th>
                        <th class="hidden-480">排序</th>
                        <th class="hidden-480">生效开始时间</th>
                        <th class="hidden-480">生效截止时间</th>
                        <th class="hidden-480">上传者</th>
                        <th class="hidden-480">上传时间</th>
                        <th class="hidden-480">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr class="odd gradeX" ng-repeat='item in $data' ng-cloak>
                        <td class="hidden-480">
                            <span>{{$index+1+preCnt}}</span>
                        </td>
                        <td class="hidden-480 msg-col-wrap">
                            <span>{{item.Title}}</span>
                        </td>
                        <td class="hidden-480">
                            <a href="{{item.Pic|picLocFilter}}" target="_blank"><img ng-src="{{item.Pic|picLocFilter}}" style="width:50px;height:50px;border:0;display:inline-block;" class="img-rounded" alt="" /></a>
                        </td>
                        <td class="hidden-480">
                            <span ng-if="!item.$edit">{{item.Seq}}</span>
                            <div ng-if="item.$edit">
                                <input type="number" class="m-wrap form-control" ng-model="item.Seq" value="{{item.Seq}}" onkeyup="value=value.replace(/[^\(^[1-9]\d*$\)]/g,'')" onpaste="value=value.replace(/[^\(^[1-9]\d*$\)]/g,'')" oncontextmenu="value=value.replace(/[^\(^[1-9]\d*$\)]/g,'')" />
                            </div>
                        </td>
                        <td class="hidden-480">
                            <span ng-if="!item.$edit">{{item.BeginDate|dateFormatFilter:true}}</span>
                            <div ng-if="item.$edit">
                                <input type="date" class="m-wrap form-control" ng-model="item.BeginDate" value="{{item.BeginDate}}" />
                            </div>
                        </td>
                        <td class="hidden-480">
                            <span ng-if="!item.$edit">{{item.EndDate|dateFormatFilter:true}}</span>
                            <div ng-if="item.$edit">
                                <input type="date" class="m-wrap form-control" ng-model="item.EndDate" value="{{item.EndDate}}" />
                            </div>
                        </td>
                        <td class="hidden-480">
                            <span>{{item.AdminName}}</span>
                        </td>
                        <td class="hidden-480">
                            <span>{{item.CreateTime|dateFormatFilter}}</span>
                        </td>
                        <td class="hidden-480">
                            <a class="btn btn-default btn-xs" ng-if="!item.$edit" ng-click="onModify(item)"><i class="icon-edit"></i>编辑</a>
                            <a ng-if="item.$edit" href="" class="btn btn-primary btn-xs" ng-click="onEdit(item)"><i class="icon-ok"></i>保存</a>
                            <a ng-if="item.$edit" class="btn btn-xs" ng-click="onCancelEdit(item)"><i class="icon-remove"></i>取消</a>
                            <a class="btn btn-default btn-xs" ng-click="onDel(item)"><i class="icon-trash"></i>删除</a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script src="lib/picupload/zyFile.js" type="text/javascript"></script>
<script src="lib/picupload/zyUpload.js" type="text/javascript"></script>